#{extends 'CRUD/layout.html' /}
#{set title:messages.get('objects.clinicalmanifestations') /}

<div id="crudShow" class="${type.name}">

    <h2 id="crudShowTitle">&{'clinicalmanifestation.edit'}</h2>

    <div class="objectForm">
    #{form action:@save(object._key()), enctype:'multipart/form-data'}
        #{crud.form fields:['name', 'clinicalManifestationType','clinicalManifestationComplaint', 'clinicalManifestationNorms']}
             #{crud.custom 'clinicalManifestationNorms'}
	    		<label for="${clinicalManifestationNorms}"><a href="@{ClinicalManifestationNorms.list()}" class="nonUnderlined">&{'objects.clinicalmanifestationnorms'}</a></label>
	    		%{norms = models.ClinicalManifestationNorm.find("byClinicalManifestation", object).fetch()}%
	    		#{if norms != null && !norms.isEmpty()}
    			<div class="list">
					#{list items:norms, as:'norm'}
			           	<li>
				           	<span id="${norm.id}" class="hiddenLinks">
								@{ClinicalManifestationNorms.show(norm.id)}
				        	</span>
				        	${norm.description}
				        </li>
				    #{/list}
				</div>
	    		#{/if}
	    		#{else}
					&{'crud.list.empty'}	    		
	    		#{/else}
        	#{/crud.custom}
        #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
        </p>
    #{/form}
    </div>

    #{form @delete(object._key())}
        <p class="crudDelete">
            <input type="submit" value="&{'clinicalmanifestation.delete'}" onclick="return confirm('&{'clinicalmanifestation.delete'}')"/>
        </p>
    #{/form}

</div>